@gpc-cli/core 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1548,6 +1548,8 @@ interface WatchOptions {
1548
1548
  render: (status: AppStatus) => string;
1549
1549
  fetch: () => Promise<AppStatus>;
1550
1550
  save: (status: AppStatus) => Promise<void>;
1551
+ /** Runs after each successful fetch+save cycle (e.g. breach notifications). */
1552
+ onStatus?: (status: AppStatus) => Promise<void> | void;
1551
1553
  }
1552
1554
  declare function loadStatusCache(packageName: string, ttlSeconds?: number): Promise<AppStatus | null>;
1553
1555
  declare function saveStatusCache(packageName: string, data: AppStatus, ttlSeconds?: number): Promise<void>;
package/dist/index.js CHANGED
@@ -3401,6 +3401,7 @@ async function runWatchLoop(opts) {
3401
3401
  const status = await opts.fetch();
3402
3402
  await opts.save(status);
3403
3403
  console.log(opts.render(status));
3404
+ await opts.onStatus?.(status);
3404
3405
  } catch (err) {
3405
3406
  console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
3406
3407
  }